<?php
/**
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.cake.libs.view.templates.layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php __('CakePHP: the rapid development php framework:'); ?>
		<?php echo $title_for_layout; ?>
	</title>
	<?php
		echo $this->Html->meta('icon');

		echo $this->Html->css('cake.generic');
		echo $this->Html->css('custom');
		echo $this->Html->script('jquery-1.6.4.min');
		echo $this->Html->script('jshashtable-2.1');
		echo $this->Html->script('jquery.numberformatter-1.2.2.min');
		echo $scripts_for_layout;
	?>
	
	<script type="text/javascript">
	jQuery(document).ready(function($) {
		$("#input_table input").keyup(function(){
			$(this).parseNumber({format:"#,###", locale:"us"});
			$(this).formatNumber({format:"#,###", locale:"us"});
		});
	});
	</script>
</head>
<body>
	<div id="container">
		<div id="header">
			<h1 style="float:left">
				<?php if (!empty($user)) { echo $group["Group"]["name"].": "; }?>				
				<?php echo $this->Html->link(__('BỆNH VIỆN RĂNG HÀM MẶT TRUNG ƯƠNG TP.HỒ CHÍ MINH', true), ''); ?>
			</h1>
			<div style="float:right">
				<?php if (!empty($user)) { ?>
					Welcome back <?php echo $user['username']; ?>!
					  <?php
					  echo $this->Html->link('Log out', array('plugin'=>null, 
					'admin'=>false, 'controller'=>'users', 'action'=>'logout'));
					} else {
					  echo $this->Html->link('Log in', array('plugin'=>null, 
					'admin'=>false, 'controller'=>'users', 'action'=>'login'));
					}
				?>
			</div>
		</div>		
		<div id="content">	
			
			<div id="main_nav" style="clear:both;float:left;margin-bottom:20px">
				<?php if (!empty($user) && $group["Group"]["id"] == 1) { ?>
					<div class="" style="float:left">
						<h3><?php __('Manage Elements'); ?></h3>
						<ul>						
							<li><?php echo $this->Html->link(__('Branches', true), array('controller' => 'branches', 'action' => 'index', 'admin'=>true)); ?>
								<ul><li><?php echo $this->Html->link(__('Cities', true), array('controller' => 'cities','action' => 'index', 'admin'=>true)); ?></li></ul>
							</li>
							<li><?php echo $this->Html->link(__('Devices', true), array('controller' => 'devices', 'action' => 'index', 'admin'=>true)); ?> </li>
							<li><?php echo $this->Html->link(__('Employees', true), array('controller' => 'employees', 'action' => 'index', 'admin'=>true)); ?> </li>
							<li><?php echo $this->Html->link(__('Treatments', true), array('controller' => 'treatments', 'action' => 'index', 'admin'=>true)); ?>
								<ul>
									<li><?php echo $this->Html->link(__('Treatment Categories', true), array('controller' => 'treatment_categories', 'action' => 'index', 'admin'=>true)); ?> </li>
								</ul>
							</li>
							<li><?php echo $this->Html->link(__('Units', true), array('controller' => 'units', 'action' => 'index', 'admin'=>true)); ?> </li>
							<li><?php echo $this->Html->link(__('Users', true), array('controller' => 'users', 'action' => 'index', 'admin'=>true)); ?>
								<ul>
									<li><?php echo $this->Html->link(__('Groups', true), array('controller' => 'groups', 'action' => 'index', 'admin'=>true)); ?> </li>
								</ul>
							</li>
							<li><?php echo $this->Html->link(__('NHD Activities', true), array('controller' => 'nhd_activities', 'action' => 'index', 'admin'=>true)); ?>
								<ul>
									<li><?php echo $this->Html->link(__('Categories', true), array('controller' => 'nhd_activity_categories', 'action' => 'index', 'admin'=>true)); ?> </li>
								</ul>
							</li>
						</ul>
					</div>
				<?php } ?>
				<?php if (!empty($user) && $group["Group"]["id"] == 2) { ?>
					<div class="" style="float:left">
						<h3><?php __('Elements'); ?></h3>
						<ul>						
							<li><?php echo $this->Html->link(__('Branches', true), array('controller' => 'branches', 'action' => 'index', 'manager'=>true)); ?></li>
						</ul>
					</div>
				<?php } ?>
				<?php if (!empty($user) && in_array($group["Group"]["id"],array(1,2))) { ?>
					<div class="" style="float:left">
						<h3><?php __('General'); ?></h3>
						<ul>						
							<li><?php echo $this->Html->link(__('Human Resources', true), array('controller' => 'human_resources', 'action' => 'index', 'manager'=>true)); ?> </li>
							<li><?php echo $this->Html->link(__('Device Resources', true), array('controller' => 'device_resources', 'action' => 'index', 'manager'=>true)); ?> </li>
							<li><?php echo $this->Html->link(__('Treatment Records', true), array('controller' => 'treatment_records', 'action' => 'index', 'manager'=>true)); ?> </li>
							<li><?php echo $this->Html->link(__('1816 Projects', true), array('controller' => 'n1816_projects', 'action' => 'index', 'manager'=>true)); ?> </li>
							<li><?php echo $this->Html->link(__('Science Projects', true), array('controller' => 'science_projects', 'action' => 'index', 'manager'=>true)); ?> </li>						
						</ul>
					</div>
					<div class="" style="float:left">
						<h3><?php __('NHD'); ?></h3>
						<ul>
							<li><?php echo $this->Html->link(__('NHD Programs', true), array('controller' => 'nhd_programs', 'action' => 'index', 'manager'=>true)); ?> </li>
							<li><?php echo $this->Html->link(__('Human Resources', true), array('controller' => 'nhd_human_resources', 'action' => 'index', 'manager'=>true)); ?> </li>
							<li><?php echo $this->Html->link(__('Device Resources', true), array('controller' => 'nhd_device_resources', 'action' => 'index', 'manager'=>true)); ?> </li>
							<li><?php echo $this->Html->link(__('Activities', true), array('controller' => 'nhd_activity_records', 'action' => 'index', 'manager'=>true)); ?> </li>						
						</ul>
					</div>
				<?php } ?>
			</div>

			<?php echo $this->Session->flash(); ?>
			<?php echo $this->Session->flash('auth'); ?>

			<?php echo $content_for_layout; ?>			

		</div>
		<div id="footer">
			<?php echo $this->Html->link(
					$this->Html->image('cake.power.gif', array('alt'=> __('CakePHP: the rapid development php framework', true), 'border' => '0')),
					'http://www.cakephp.org/',
					array('target' => '_blank', 'escape' => false)
				);
			?>
		</div>
	</div>
	<?php echo $this->element('sql_dump'); ?>
</body>
</html>